startShift(workerID)
{
	if worker has active shift
		if so send error for shift creation or end the last one if passed time is more than 8 hours?
	
	create shift
	
	find all scheduled routes
		one hour prior to arrival till 8 hours passet arrival
	
	return scheduled routes and new shift ID
}

passsed beacon on shift(shiftID, beaconID)
{
	add beacon to passedbeacon
		passed beacon(shiftID.workerID, beaconID)
		update battery level of beacon

	 if beacon is in one of the currently active routes, 
		active meaning current time is between start/end assignedroute on shift tolerance 1 hour
		add beacon to checkpointCleared
			if timer active
				OK upadate and delay the notification timer
				ELSE set timer to predefined timer
		
		if beacon is the last checkpoint on current route
			OK dissable timers, send notification to cotrol that asigment has been completed
}

passed beacon(workerID, beaconID)
{
	add beacon to passedbeacon
	update battery level of beacon
}

end shift(shiftID)
{
	if all asigments completed
		OK end shift
		ELSE delete the DB and cry, I duno perhaps notify the worker and ask him again to pass the checkpoints
}

get asigmentbyId
get asigmentsbyWorkerID

Create asigment(start, end, workerID, routeID)
{
	check if worker is busy at that time
	create and return the asigment
}

update asigment(new asigment)
{
	get by asigmentID
	update
	return updated asigment
}

delete asigment(asigmentID)
{
	if asigment has been started
		delete things in checkpointCleared
	
	delete asigment
}